package cn.enilu.flash.bean.entity.park;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.validation.constraints.NotNull;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/11/05 9:02)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="parking_info")
@Table(appliesTo = "parking_info",comment = "车位信息")
@Data
@EntityListeners(AuditingEntityListener.class)
public class ParkingInfo extends BaseEntity {
    @Column(name = "community_id", columnDefinition = "BIGINT COMMENT '社区ID'")
    @NotNull(message = "社区未关联")
    private Long communityId;

    @Column(name = "building_id", columnDefinition = "BIGINT COMMENT '大楼ID'")
    @NotNull(message = "大楼未关联")
    private Long buildingId;

    @Column(name = "room_id", columnDefinition = "BIGINT COMMENT '房间ID'")
    @NotNull(message = "房间未关联")
    private Long roomId;

    @Column(name = "code", columnDefinition = "VARCHAR(16) COMMENT '编号'")
    @NotNull(message = "编号不能为空")
    private String code;

    @Column(name = "name", columnDefinition = "VARCHAR(128) COMMENT '名称'")
    @NotNull(message = "名称不能为空")
    private String name;

    @Column(name = "position", columnDefinition = "VARCHAR(512) COMMENT '位置'")
    @NotNull(message = "位置不能为空")
    private String position;

    @Column(name = "owner_flag", columnDefinition = "INT COMMENT '租售方式'")
    @NotNull(message = "租售方式不能为空")
    private Integer ownerFlag;

    @Column(name = "parking_type", columnDefinition = "INT COMMENT '车位类型'")
    @NotNull(message = "车位类型不能为空")
    private Integer parkingType;
}
